<html>
<head><meta charset="utf-8"><title>implementing runtime-agnostic crate · wg-async-foundations · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/index.html">wg-async-foundations</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html">implementing runtime-agnostic crate</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="234853006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/234853006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#234853006">(Apr 16 2021 at 13:30)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> I got a bit distracted by my cat so missed the part about timers. Is that about a timeout future?</p>



<a name="235147248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235147248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235147248">(Apr 19 2021 at 08:49)</a>:</h4>
<p><span class="user-mention" data-user-id="400241">@Zeeshan Ali</span>sorry I missed this. In this particular case we never really said what the timer was for since they're implementing a made up, proprietary protocol.</p>



<a name="235154769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235154769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235154769">(Apr 19 2021 at 09:55)</a>:</h4>
<p>Ah ok. I was asking cause if it's about timeout futures, we have those in <a href="https://docs.rs/async-io/1.4.0/async_io/struct.Timer.html">async-io</a> and hence it's not a problem for runtime-agnosticism</p>



<a name="235155893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235155893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alice Ryhl <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235155893">(Apr 19 2021 at 10:03)</a>:</h4>
<p>I don't think using something like async-io really qualifies as runtime agnostic. Like, sure, if you use it it will work correctly in any runtime, but now your application suddenly has multiple timer drivers.</p>



<a name="235156095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235156095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235156095">(Apr 19 2021 at 10:05)</a>:</h4>
<p>that's why I was asking what is meant by timers. :) What's the issue with multiple timer drivers?</p>



<a name="235156909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235156909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alice Ryhl <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235156909">(Apr 19 2021 at 10:12)</a>:</h4>
<p>I think you should be able to tell the difference between crates that can use the runtime's timer driver, and crates that spawn their own timer driver, and that becomes more difficult to do if everyone uses the same words for both things.</p>



<a name="235156994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235156994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235156994">(Apr 19 2021 at 10:13)</a>:</h4>
<p>Code bloat might be an issue. Also this requires a deep understanding of the async ecosystem to get things right.</p>



<a name="235159959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235159959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235159959">(Apr 19 2021 at 10:42)</a>:</h4>
<p><span class="user-mention" data-user-id="218683">@Alice Ryhl</span> I see. Yeah that's an issue but I don't agree that it's an obstacle to runtime-agnosticism. Especially, I doubt Alan would know or care about this.</p>



<a name="235160338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235160338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235160338">(Apr 19 2021 at 10:46)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> Bloat is definitely a problem but I fear it's a more general one. E.g I'm using async-locks in zbus but most users use it with tokio, which comes with its own locks.</p>



<a name="235180107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235180107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Sean McArthur <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235180107">(Apr 19 2021 at 13:29)</a>:</h4>
<p>It's also spawning an extra background thread to run the driver/reactor.</p>



<a name="235202976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235202976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zeeshan Ali <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235202976">(Apr 19 2021 at 15:45)</a>:</h4>
<p>Ah true, that makes it worse. Still, at least for me, that's not that big a price to pay for providing API that users can just use with any runtime out of the box.</p>



<a name="235371441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/187312-wg-async-foundations/topic/implementing%20runtime-agnostic%20crate/near/235371441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lucio Franco <a href="https://rust-lang.github.io/zulip_archive/stream/187312-wg-async-foundations/topic/implementing.20runtime-agnostic.20crate.html#235371441">(Apr 20 2021 at 16:14)</a>:</h4>
<p>Users may not like this though and its a pretty implicit choice to understand.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>